********************************************************************************
***Random sample scatterplots, standardized scaling

*Create standardized cons1 and od_exp variables
gen cut_cons1 = cons1
replace cut_cons1 = 600 if cons1 > 600 & cons1 !=.
gen cut_od_exp = od_exp
replace cut_od_exp = 300 if od_exp > 300 & od_exp !=.

*Create standardized cons1 and od_exp variables for households
gen cut_cons1_HH = cons1_HH
replace cut_cons1_HH = 600 if cons1_HH > 600 & cons1_HH !=.
gen cut_od_exp_HH = od_exp_HH
replace cut_od_exp_HH = 300 if od_exp_HH > 300 & od_exp_HH !=.

*Make sure by taking a random subset that we get around 3000 observations in each figure


**********************************************************
*Figure 1: Co-holding Deposit Account Balances and Overdraft Balances
* 1A: Overdrafts vs. Desposit Balances
**********************************************************	
*Any individual
summ cut_cons1 cut_od_exp if random<3
scatter cut_od_exp cut_cons1 if random<3, ///
mcolor(blue) ///
title("Overdraft holdings in consumption days", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(0 100 200 300, labsize(medium) angle(0)) ///
xlabel(0 200 400 600, labsize(medium))
graph export "Figures/ScatterCashOverdraft_SameScale.png", width(1800) height(1300) replace
graph export "Figures/ScatterCashOverdraft_SameScale.pdf", replace


**********************************************************
*Figure 4: Co-holding by Singles vs. Multi-Person Households
**********************************************************	
*Single individuals
summ cut_od_exp cut_cons1 if random<4 & alwaysin2memberhh==0
scatter cut_od_exp cut_cons1 if random<4 & alwaysin2memberhh==0, ///
mcolor(blue) ///
title("Overdraft holdings in consumption days", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(0 100 200 300, labsize(medium) angle(0)) ///
xlabel(0 200 400 600, labsize(medium)) 
graph export "Figures/ScatterCashOverdraftS_SameScale.png", width(1800) height(1300) replace
graph export "Figures/ScatterCashOverdraftS_SameScale.pdf", replace

*Linked individuals
summ cut_od_exp cut_cons1 if random<25 & alwaysin2memberhh==1
scatter cut_od_exp cut_cons1 if random<25 & alwaysin2memberhh==1, ///
mcolor(blue) ///
title("Overdraft holdings in consumption days", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(0 100 200 300, labsize(medium) angle(0)) ///
xlabel(0 200 400 600, labsize(medium))
graph export "Figures/ScatterCashOverdraftL_SameScale.png", width(1800) height(1300) replace
graph export "Figures/ScatterCashOverdraftL_SameScale.pdf", replace

*Couples 
summ cut_cons1_HH cut_od_exp_HH if random<50 & hh_edate_obs==1 //*3,034 obs
scatter cut_od_exp_HH cut_cons1_HH if random<50 & hh_edate_obs==1, ///
mcolor(blue) ///
title("Overdraft holdings in consumption days", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(0 100 200 300, labsize(medium) angle(0)) ///
xlabel(0 200 400 600, labsize(medium)) 
graph export "Figures/ScatterCashOverdraftHH_SameScale.png", width(1800) height(1300) replace
graph export "Figures/ScatterCashOverdraftHH_SameScale.pdf", replace
